<?php include("header.inc.php")?> 
<?php include("navigation.inc.php")?>       
<?php include("left.inc.php")?>   
    
<?php
 function word_split($str,$words) {
	$arr = preg_split("/[\s]+/", $str,$words+1);
	$arr = array_slice($arr,0,$words);
	return join(' ',$arr);
}
?>

        <div id="mainContent" class="grid_7">
        <!-- Phan Dau Tien Cua Main Content: Anh -->
        	<div id="gallery" class="grid_7 round-corner4">        	
                <img src="img/thungo.jpg" alt="truong thpt nam sach" style="padding-left:30px;" />
                <h1 align="center" style="font-size:14px; font-weight:600"> KỈ NIỆM 50 NĂM THÀNH LẬP TRƯỜNG THPT NAM SÁCH (1962 - 2012)</h1>
                <div id="baihattruyenthong">
                	<h2> Bài Hát Truyền Thống Của Trường</h2><br />
                    <!--<audio controls="controls" height="50px" width="100px">
                      <source src="songs/1.mp3" type="audio/mpeg" />
                      <source src="songs/1.ogg" type="audio/ogg" />
                    <embed height="50px" width="100px" src="songs/1.mp3" />
                    </audio>-->
                    
 <!--<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="songs/1.mp3" width="280" height="45" autostart="0" loop="0">-->
                </div>
                <div id="small_gallery">
                </div>
            </div>
         <!-- Phan Tin Tuc -->
            <div id="news" class="grid_7">
            	<div class="tittle">TIN TỨC VÀ SỰ KIỆN</div>
                <?php
							$sql = "SELECT  * FROM tintuc WHERE STATUS = 1 ORDER BY thoigian DESC LIMIT 1";
							$query = mysql_query($sql) or die("Can't query tintuc noi bat in index");
							while ($row = mysql_fetch_array($query))
							{
							?>
                            
             	<div class="tinnoibat">
                	<div class="tieudetinnoibat"><a href = "tinchitiet.php?id=<?php echo $row['idtintuc'];?>"  title="<?=$row['tieude']?>"> <?php echo  word_split($row['tieude'],10);?> </a> </div>
                    <div class="thoigiantinnoibat"><?php echo ($time = date('d-m-Y G:i',strtotime($row['thoigian'])));?></div>
                    <div class="tomtattinnoibat"><?php echo $row['tomtat']?></div>
                </div>
				<?php
							}
				?>
                <div id="tinkhac" class="tonghoptin">
                	<p align="left" style="padding:10px 0 5px 5px; color:#06F; font-weight:bold">CÁC TIN KHÁC</strong>
                    <ul>
                    	 <?php
							$sql = "SELECT  * FROM tintuc WHERE STATUS = 1 ORDER BY thoigian DESC LIMIT 5";
							$query = mysql_query($sql) or die("Can't query tintuc khac");
							while ($row = mysql_fetch_array($query))
							{
							?>
							<li><a href = "tinchitiet.php?id=<?php echo $row['idtintuc'];?>" title="<?=$row['tieude']?>"> <?php echo  word_split($row['tieude'],10);?> </a></li>
							<?php
							}
						?>
                        
                    </ul>
                    <div class="xemchitiet"><a href="tintuc.php">Xem Tất Cả</a></div>
                </div>
                <div class="clear"></div>   
             </div>
             <!-- Het Tin tuc -->
             <!-- Phan Thong Bao -->
            <div id="thongbao" class="grid_7">
            	<div class="tittle">THÔNG BÁO CỦA NHÀ TRƯỜNG</div>
             	<?php
							$sql = "SELECT  * FROM thongbao WHERE STATUS = 1 ORDER BY thoigian DESC LIMIT 1";
							$query = mysql_query($sql) or die("Can't query thongbao noi bat in index");
							while ($row = mysql_fetch_array($query))
							{
							?>
                            
             	<div class="tinnoibat">
                	<div class="tieudetinnoibat"><a href = "thongbaochitiet.php?id=<?php echo $row['idthongbao'];?>" title="<?=$row['tieude']?>"> <?php echo  word_split($row['tieude'],10);?> </a> </div>
                    <div class="thoigiantinnoibat"><?php echo ($time = date('d-m-Y G:i',strtotime($row['thoigian'])));?></div>
                    <div class="tomtattinnoibat"><?php echo $row['tomtat']?></div>
                </div>
				<?php
							}
				?>
                <div id="thongbaokhac" class="tonghoptin">
                	<p align="left" style="padding:10px 0 5px 5px; color:#06F; font-weight:bold">CÁC THÔNG BÁO KHÁC</strong>
                    <ul>
                    	 <?php
							$sql = "SELECT  * FROM thongbao WHERE STATUS = 1 ORDER BY thoigian DESC LIMIT 5";
							$query = mysql_query($sql) or die("Can't query thong bao khac");
							while ($row = mysql_fetch_array($query))
							{
							?>
							<li><a href = "thongbaochitiet.php?id=<?php echo $row['idthongbao'];?>" title="<?=$row['tieude']?>"><?php echo  word_split($row['tieude'],10);?> </a></li>
							<?php
							}
						?>
                    </ul>
                     <div class="xemchitiet"><a href="thongbao.php">Xem Tất Cả</a></div>
                </div>
                <div class="clear"></div>   
            </div>
            <!-- Het thong bao -->
            <!-- Phan Thanh Tich -->
            <div class="grid_7 ">
            	<div class="tittle">THÀNH TÍCH NHÀ TRƯỜNG</div>
             	<?php
							$sql = "SELECT  * FROM thanhtich WHERE STATUS = 1 ORDER BY thoigian DESC LIMIT 1";
							$query = mysql_query($sql) or die("Can't query thanhtich noi bat in index");
							while ($row = mysql_fetch_array($query))
							{
							?>
                            
             	<div class="tinnoibat">
                	<div class="tieudetinnoibat"><a href = "tinchitiet.php?id=<?php echo $row['idthanhtich'];?>" title="<?=$row['tieude']?>"> <?php echo  word_split($row['tieude'],10);?> </a> </div>
                    <div class="thoigiantinnoibat"><?php echo ($time = date('d-m-Y G:i',strtotime($row['thoigian'])));?></div>
                    <div class="tomtattinnoibat"><?php echo $row['tomtat']?></div>
                </div>
				<?php
							}
				?>
                <div id="thanhtichkhac" class="tonghoptin">
                	<p align="left" style="padding:10px 0 5px 5px; color:#06F; font-weight:bold">CÁC THÀNH TÍCH KHÁC</strong>
                    <ul>
                    	 <?php
							$sql = "SELECT  * FROM thanhtich WHERE STATUS = 1 ORDER BY thoigian DESC LIMIT 5";
							$query = mysql_query($sql) or die("Can't query thanhtich khac");
							while ($row = mysql_fetch_array($query))
							{
							?>
							<li><a href = "thanhtichchitiet.php?id=<?php echo $row['idthanhtich'];?>" title="<?=$row['tieude']?>"><?php echo  word_split($row['tieude'],10);?> </a></li>
							<?php
							}
						?>
                    </ul>
                     <div class="xemchitiet"><a href="thanhtich.php">Xem Tất Cả</a></div>
                </div>
                <div class="clear"></div>   
            </div>
            <!-- Het Thanh Tich -->
        </div>
     
<?php include("right.inc.php")?>  
<?php include("footer.inc.php")?>  

